﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Details.aspx.cs" Inherits="Admin_Details" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Restaurant Details</title>
    <style type="text/css">
    form, html, body
    {
        background-color:#FFF8C6;
        font: normal 13px "Segoe UI", Arial, Verdana;
        color: black;
    }
    
    .reply_box
    {
        border: solid 1px #666;    
    }

    .reply_box[disabled]
    {
        border: 0;    
        background-color: white;
    }
    
    .mailBtn
    {
        padding: 0;
        margin: 4px 0 0 0;
        list-style: none;
        float: right;
    }
    
    .mailBtn li
    {
        float: left;
    }
    
    .mailBtn li a
    {
        display: block;
        border: solid 1px black;
        background: maroon;
        width: 100px;
        line-height: 22px;
        color: white;
        text-decoration: none;
        font-weight: bold;
        font-size: 11px;
        margin: 0 0 0 2px;
    }
    
    .mailBtn li a:hover
    {
        text-decoration: underline;
    }
    
    td
    {
        padding:2px 0 2px 0;
    }
    </style>
    <script type="text/javascript">
    function GetRadWindow()  
    {  
        var oWindow = null;  
        if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog  
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well)  
          
        return oWindow;  
    }  
    function CloseWnd()
    {
        GetRadWindow().close();
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager" runat="server" />
        <telerik:RadSkinManager ID="RadSkinManager" runat="server" Skin="Sunset">
        </telerik:RadSkinManager>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:EatDrinkConnectionString %>" 
            SelectCommand="SELECT * FROM [Restaurant] WHERE ([RestID] = @RestID)">
            <SelectParameters>
                <asp:QueryStringParameter Name="RestID" QueryStringField="RestID" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:EatDrinkConnectionString %>" 
            SelectCommand="SELECT * FROM [Location]"></asp:SqlDataSource>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"
            LoadingPanelID="RadLoadingPanel1">
            <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" Width="100%"
                CellPadding="0" Height="100%" GridLines="None" DataSourceID="SqlDataSource1">
                <Fields>
                    <asp:TemplateField HeaderText="RestName" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtRestName" runat="server" Text='<%#Eval("RestName")%>' Width="250px"
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="RestCat" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtRestCat" runat="server" Text='<%#Eval("RestCat")%>' Width="250px"
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>         
                    <asp:TemplateField HeaderText="Address" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtAddress" runat="server" Text='<%#Eval("Address")%>' TextMode="MultiLine" Width="250px"
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Address Description" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtAddressDescription" runat="server" Text='<%#Eval("AddressDescription")%>' TextMode="MultiLine" Width="250px"
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Slogan" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtSlogan" runat="server" Text='<%#Eval("Slogan")%>' Width="250px"
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Short Description" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtShortDescription" runat="server" Text='<%#Eval("ShortDescription")%>' Width="250px" TextMode="MultiLine"
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Long Description" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <div id="divLongDescription" runat="server">
                                <telerik:RadEditor Skin="Office2007" Height="600px" ID="RadEditor1" runat="server"
                                    Enabled="true" Width="500px" Content='<%# Eval("LongDescription") %>' EnableViewState="false">
                                    <ImageManager ViewPaths="~/Images/Restaurants" />
                                    <FlashManager ViewPaths="~/Images/Restaurants" />
                                </telerik:RadEditor>
                            </div>
                            <asp:Label ID="lbLongDescription" runat="server" Text='<%# Eval("LongDescription") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Location" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:DropDownList ID="ddlLocation" runat="server" AppendDataBoundItems="true" DataSourceID="SqlDataSource2"
                                DataValueField="LocationID" DataTextField="District" SelectedValue='<%# Eval("LocationID") %>' Enabled="false">
                                <asp:ListItem Selected="True" Text="Select" Value=""></asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Phone Number" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtPhoneNumber" runat="server" Text='<%#Eval("PhoneNumber")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Email" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtEmail" runat="server" Text='<%#Eval("Email")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Fax" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtFax" runat="server" Text='<%#Eval("Fax")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Website" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtWebsite" runat="server" Text='<%#Eval("Website")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Number of Seats" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtSeatCount" runat="server" Text='<%#Eval("SeatCount")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="IsOrder" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:DropDownList ID="ddlIsOrder" runat="server" AppendDataBoundItems="true" DataSource='<%# (new string[] {"Chấp nhận", "Không nhận"})%>'
                                SelectedValue='<%# Eval("IsOrder") %>' Enabled="false">
                                <asp:ListItem Selected="True" Text="Select" Value=""></asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="OffDate" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtOffDate" runat="server" Text='<%#Eval("OffDate")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="ServedTime" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtServedTime" runat="server" Text='<%#Eval("ServedTime")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="PaymentType" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtPaymentType" runat="server" Text='<%#Eval("PaymentType")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Language" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtLanguage" runat="server" Text='<%#Eval("Language")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="AveragePrice" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtAveragePrice" runat="server" Text='<%#Eval("AveragePrice")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="SubServices" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtSubServices" runat="server" Text='<%#Eval("SubServices")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Menu" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <div id="divMenu" runat="server">
                                <telerik:RadEditor Skin="Office2007" Height="600px" ID="RadEditor2" runat="server"
                                    Enabled="true" Width="500px" Content='<%# Eval("Menu") %>' EnableViewState="false">
                                    <ImageManager ViewPaths="~/Images/Restaurants" />
                                    <FlashManager ViewPaths="~/Images/Restaurants" />
                                </telerik:RadEditor>
                            </div>
                            <asp:Label ID="lbMenu" runat="server" Text='<%# Eval("Menu") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Note" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtNote" runat="server" Text='<%#Eval("Note")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Search" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtSearch" runat="server" Text='<%#Eval("Search")%>' Width="250px" TextMode="MultiLine"
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="ImageFolderName" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtImageFolderName" runat="server" Text='<%#Eval("ImageFolderName")%>' Width="250px"
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Flash" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtFlash" runat="server" Text='<%#Eval("Flash")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Order" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtOrder" runat="server" Text='<%#Eval("Order")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="UserID" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtUserID" runat="server" Text='<%#Eval("UserID")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="IsActivated" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:DropDownList ID="ddlIsActivated" runat="server" AppendDataBoundItems="true"
                                DataSource='<%# (new string[] {"True", "False"})%>' SelectedValue='<%# Eval("IsActivated") %>' Enabled="false">
                                <asp:ListItem Selected="True" Text="Select" Value=""></asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="URL" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:TextBox ID="txtUrl" runat="server" Text='<%#Eval("Url")%>' Width="250px" 
                            BorderStyle="None" Enabled="false" BackColor="#FFF8C6" ForeColor="Black" Font-Names="Segoe UI" Font-Size="13px"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Fields>
            </asp:DetailsView>
            <div style="text-align: center;">
                <ul class="mailBtn">
                    <li><asp:LinkButton ID="Button1" runat="server" Text="Edit" OnClick="Button1_Click"/></li>
                    <li><asp:LinkButton ID="Button2" runat="server" Text="Close" OnClientClick="CloseWnd();return false;" /></li>
                </ul>
            </div>
        </telerik:RadAjaxPanel>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="100%"
            Width="75px" BackColor="White" Transparency="60">
            <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
                style="border: 0px;" />
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxPanel1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    </form>
</body>
</html>